import {SET_USER_NAME} from "../actionTypes"
export interface userObj{
    user:{
    name:string,
    id:number,
    password:string
}
}
const initialState = {
        name:'yonyou',
        id:'',
        password:''
}
export interface userType {
    type:string,
    payload?:any
}
export default (state = initialState,{type,payload}:userType) => {
    switch (type){
        case SET_USER_NAME:
            return {...state,name:payload}
            default :
            return state
    }
}